const {
    ApolloClient,
    InMemoryCache,
    gql,
    HttpLink,
} = require('@apollo/client');
const fetch = require('cross-fetch');

const client = new ApolloClient({
    link: new HttpLink({
        uri: 'https://48p1r2roz4.sse.codesandbox.io/',
        fetch,
    }),
    cache: new InMemoryCache(),
});

client
    .query({
        query: gql`
            query GetRates {
                rates(currency: "USD") {
                    currency
                    rate
                }
            }
        `,
    })
    .then((result) => console.log(result.data.rates));
